<template>
  <div class="denglu">
    <h1>登陆</h1>
    <!--input输入框-->
    <el-input
      v-model="account"
      placeholder="请输入账号"
      style="width: 600px; height: 50px"
    ></el-input>
    <br />
    <!--input输入框-->
    <el-input
      placeholder="请输入密码"
      v-model="password"
      show-password
      style="width: 600px; height: 50px"
    ></el-input>
    <br />
    <!--登陆-->
    <button v-on:click="login">登陆</button>
  </div>
</template>

<script>
export default {
  name: "Axios",
  created() {},
  data() {
    return {
      account: "",
      password: ""
    };
  },
  props: {},
  methods: {
    login: function () {
      console.log("账号" + this.account);
      console.log("密码" + this.password);  
      this.$axios.post("/Login/login", {
          email: this.account,
          password: this.password,
        })
        .then(function (response) {
         
          console.log(response);
          console.log("response.data.code!!!"+response.data.code);
          if(response.data.code=="0000"){
            window.location.href = "/yemian";
            
            console.log("======成功==========" + this);
            console.log("======成功==========");
          }else{
            
            console.log("======失败==========" + this);
            console.log("======失败==========");
          }
        })
        .catch(function (error) {
          console.log("==error==============");
          console.log(error);
        });
    },
    // 重置方法
    reset() {
      this.$refs.loginForm.resetFields();
    },
  },
};
</script>

<style scoped></style>